import zhRequest from '../index'
import { IAccount, IData, ILoginResult } from './type'
enum LoginAPI {
  AccountLogin = '/login',
  LoginUserInfo = '/users/',
  UserMenus = '/role/'
}
export function accountLoginRequest(account: IAccount) {
  return zhRequest.post<IData<ILoginResult>>({
    url: LoginAPI.AccountLogin,
    data: account
  })
}
export function requestUserInfoById(id: number) {
  return zhRequest.get<IData>({
    url: LoginAPI.LoginUserInfo + id
  })
}
export function requestUserMenuByRoleId(id: number) {
  return zhRequest.get<IData>({
    url: LoginAPI.UserMenus + id + '/menu'
  })
}
